<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@page import="java.util.Set"%>    
<%@page import="java.util.HashMap"%>
<%@page import="model.Doc"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Agrupadinho - Resultados</title>

<STYLE type="text/css">@import url("site.css");</STYLE>
</head>

<body>
<div id="site" style="margin: 0 auto; text-align: left" >

<table style="width: 800px">
<tr>

<td style="vertical-align: top; width: 250px; text-align: left">


<h1>Agrupadinho</h1>

<%
String query = request.getParameter("query");
if (query == null)
	query = "";
%>

<div>
<form action="search" method="post"><input type="text"
	name="query" value="<%=query %>" /> <input type="submit" name="submit" value="buscar" />
</form>
</div>

<%
	HashMap<String, Set<Doc>> clusters = 
		(HashMap<String, Set<Doc>>) session.getAttribute("clusters");
%> 

<p><%=clusters.size()%> clusters encontrados (x segs)</p>

<ul>
			<%
				if (clusters != null)
					for (String name : clusters.keySet()) {
						Set<Doc> cluster = clusters.get(name);
			%>
			<li><%=name%></li>
			<%
				}
			%>
		</ul>
</td>

<td>
<iframe src="ClusterServlet" width="500" height="480">
  <p>Your browser does not support iframes.</p>
</iframe>
</td>

</tr>
</table>

</div>
</body>
</html>